/* ********************************************************************************************
*  Alvin Baldemeca
*  Tetris Project
*  Course: TCSS 305 , Alan Fowler
*  Term: Spring 2012
*  UNIVERISTY OF WASHINGTON TACOMA
*
*
**********************************************************************************************/



package gui.actions;







import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JFrame;
import javax.swing.JPanel;


/**
 * This action displays a frame when this action is called.
 * @author Alvin Baldemeca
 * @version 5/10/2012
 */
@SuppressWarnings("serial")
public class CustomizeKeysAction extends AbstractAction
{
  
  /**
   * The height of frame for the message to be displayed.
   */
  private static final int HEIGHT = 300;
  
  /**
   * The width of the frame for the message to be displayed.
   */
  private static final int WIDTH = 300;
  
  /**
   * The panel to perform the action to.
   */
  private final JPanel my_panel;
  
  /**
   * Creates a CustomizeKeysAction.
   * @param the_panel the JPanel that will be displayed when this action is called.
   */
  public CustomizeKeysAction(final JPanel the_panel) 
  {
    super("Customize Keys");
    my_panel = the_panel;
    putValue(Action.MNEMONIC_KEY, KeyEvent.VK_C);
    putValue(Action.SELECTED_KEY, true);
  }

  @Override
  public void actionPerformed(final ActionEvent the_event) 
  {
    final JFrame testframe = new JFrame();
    testframe.setSize(HEIGHT, WIDTH);
    testframe.setVisible(true);
    testframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    testframe.add(my_panel);
    testframe.setVisible(true);
  }
  
}